﻿using PlainConcepts.Fx.Dnie.CertStore;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Security.Cryptography.X509Certificates;
using PlainConcepts.Fx.Dnie;
using System;

namespace PlainConcepts.Fx.Dnie.Test
{
    
    
    /// <summary>
    ///This is a test class for CertStoreHelperTest and is intended
    ///to contain all CertStoreHelperTest Unit Tests
    ///</summary>
    [TestClass()]
    public class CertStoreHelperTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


       

        /// <summary>
        ///A test for OpenStore
        ///</summary>
        [TestMethod()]
        [DeploymentItem("PlainConcepts.Fx.Dnie.dll")]
        public void OpenStoreTest()
        {
            CertStoreHelper_Accessor target = new CertStoreHelper_Accessor(); 
            target.OpenStore();
            
        }

        /// <summary>
        ///A test for GetDnieIdentity
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(InvalidOperationException))]
        public void GetDnieIdentityTest_InvalidCard()
        {
            CertStoreHelper target = new CertStoreHelper(); 
            
            target.GetDnieIdentity();
            
        }

        /// <summary>
        ///A test for GetCertificateToSign
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(InvalidOperationException))]
        public void GetCertificateToSignTest()
        {
            CertStoreHelper target = new CertStoreHelper(); 
            
            X509Certificate2 actual;
            actual = target.GetCertificateToSign();
            
        }

        /// <summary>
        ///A test for Finalize
        ///</summary>
        [TestMethod()]
        [DeploymentItem("PlainConcepts.Fx.Dnie.dll")]
        public void FinalizeTest()
        {
            CertStoreHelper_Accessor target = new CertStoreHelper_Accessor(); // TODO: Initialize to an appropriate value
            target.Finalize();
            
        }

        /// <summary>
        ///A test for Dispose
        ///</summary>
        [TestMethod()]
        public void DisposeTest1()
        {
            CertStoreHelper target = new CertStoreHelper(); 
            bool disposing = false; 
            target.Dispose(disposing);
            
        }

        /// <summary>
        ///A test for Dispose
        ///</summary>
        [TestMethod()]
        public void DisposeTest()
        {
            CertStoreHelper target = new CertStoreHelper(); // TODO: Initialize to an appropriate value
            target.Dispose();
            
        }

        /// <summary>
        ///A test for CloseStore
        ///</summary>
        [TestMethod()]
        [DeploymentItem("PlainConcepts.Fx.Dnie.dll")]
        public void CloseStoreTest()
        {
            CertStoreHelper_Accessor target = new CertStoreHelper_Accessor(); // TODO: Initialize to an appropriate value
            target.CloseStore();
            
        }

        /// <summary>
        ///A test for CertStoreHelper Constructor
        ///</summary>
        [TestMethod()]
        public void CertStoreHelperConstructorTest()
        {
            CertStoreHelper target = new CertStoreHelper();
           
        }
    }
}
